﻿<%@ WebHandler Language="C#" Class="DownloadFile" %>

using System.Web;

public class DownloadFile : IHttpHandler {
    
    public void ProcessRequest (HttpContext context) {
        HttpResponse r = context.Response;
        r.Clear();
        r.ContentType = "application/octet-stream";
        r.AddHeader("Content-Disposition", "attachment; filename=abc.txt");
        //r.WriteFile(Server.MapPath("\\servername\folder1\folder2\folder3\abc.txt"));
        r.End();
    }
 
    public bool IsReusable {
        get {
            return false;
        }
    }

}